package cn.wolfcode.crm.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

//采购订单
@Getter
@Setter
public class OrderBill extends BaseDomain {
    public static final int STATUS_QUIT=0; //未审核
    public static final int STATUS_EXIST=1; //审核
    private String sn;//编码
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date vdate; //业务时间

    private int status; //订单状态

    private BigDecimal totalAmount; //订单总金额

    private BigDecimal totalNumber; //订单总数量

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date auditTime; //订单审核时间

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date inputTime; //订单;录入时间

    private Employee  inputUser; //录入人

    private Employee auditor; //审核人

    private Supplier   supplier; //供应商

    //订单和订单明细的关系为一对多
    List<OrderBillItem> items = new ArrayList<>();

}
